Wild.library doc...

TABLE OF CONTENTS

wild.library/AddWildApp
wild.library/AddWildThread
wild.library/AllocVecPooled
wild.library/BuildWildObject
wild.library/DisplayFrame
wild.library/FindWildApp
wild.library/FreeVecPooled
wild.library/FreeWildObject
wild.library/GetWildAppTags
wild.library/InitFrame
wild.library/LoadExtension
wild.library/LoadFile
wild.library/LoadModule
wild.library/LoadTable
wild.library/LoadWildObject
wild.library/KillExtension
wild.library/KillModule
wild.library/KillTable
wild.library/RealyzeFrame
wild.library/RemWildApp
wild.library/RemWildThread
wild.library/SetWildAppTags
wild.library/--tags--
wild.library/--Building tags--
wild.library/--Display tags--
wild.library/--Loading tags--
wild.library/--Object tags--
wild.library/--Saving tags--
wild.library/--TDCore tags--
wild.library/--WildApp tags--
wild.library/--WildThread tags--

wild.library/AddWildApp
NAME

AddWildApp
SYNOPSIS
wildapp = AddWildApp(WildPort,TagList);
D0 A0 A1
struct WildApp *AddWildApp(struct MSGPort *,struct TagItem *);
FUNCTION
Allocates a WildApp struct, and initializes it with the provided tags. Not specified tags are set to wild's default. SetWildAppTags is called by this function.
INPUTS
WildPort - A STD exec MSGPort, used to comunicate with wild
TagList - taglist to initialize the app.
RESULT
WildApp - a WildApp struct, used for everything in Wild.
SEE ALSO
RemWildApp,SetWildAppTags
wild.library/AddWildThread
NAME
AddWildThread
SYNOPSIS
wildthread= AddWildThread(WildApp,TagList)
D0 A0 A1
struct WildThread *AddWildThread(struct WildApp *,struct TagItem *);
FUNCTION
Allocated a WildThread struct and starts the new thread.Note: Your thread doesn't need to preserve any regs, or to manage any Process Flag (those boring PRF_FreeCli,FreeOutput,Free??) because Wild manages them for you. The WildThread structure is given to the Thread as input in the A0 register: read there your Args (specified with WITH_Args tag.). See tags definitions.
INPUTS
WildApp - A WildApp structure.
TagList - A TagList to init the Thread.
RESULT
WildThread - A WildThread structure.
SEE ALSO
RemWildThread
wild.library/AllocVecPooled
NAME
AllocVecPooled
SYNOPSIS
memory = AllocVecPooled(memsize,pool);
D0 D0 A0
UBYTE *AllocVecPooled(memsize,pool);
FUNCTION
Allocates a chunk of memory from a memory pool, and keeps the size and pool info there, so when you free you need only the chunk address, not the size or the pool.
INPUTS
memsize = memory size needed.
pool = the pool to alloc from; now that's a normal exec pool, but you should use only wild's pools: in the future I may expand them.
RESULT
memory = a memory block, or 0.
SEE ALSO
FreeVecPooled
wild.library/BuildWildObject
NAME
BuildWildObject
SYNOPSIS
object= BuildWildObject(tags)
D0 A0
void *BuildWildObject(struct TagItem *tags);
FUNCTION
That's a powerful function to create anything in the Scene.It's quite low-level, is mainly used by the Loader modules when loading a scene-file.You can use this func to create new objects or to modify existing.See tags description.Then, you can specify ATTRS and FRIENDS, but not CHILDS. Those are used to code Loader modules. See object tags definitions and build tags definitions.
INPUTS
tags = A taglist defining the properties of the object to build or modify.
RESULT
object = The modified or builded object.
SEE ALSO
FreeWildObject(),LoadWildObject(),objects.h
wild.library/FreeVecPooled
NAME
FreeVecPooled
SYNOPSIS
FreeVecPooled(memoryblock)
A1
void FreeVecPooled(UBYTE *memoryblock);
FUNCTION
Frees a block of memory allocated with AllocVecPooled.
INPUTS
memoryblock = address of the memoryblock to free.
RESULT
None.
SEE ALSO
AllocVecPooled,exec.library/FreeVec
wild.library/InitFrame
NAME
InitFrame
SYNOPSIS
InitFrame(WildApp)
A0
void InitFrame(struct WildApp *wildApp);
FUNCTION
Inits a new frame, and currently does also engine manutention, so refreshes it first of all.
Then, calls the Display's InitFrame() and the Draw's InitFrame().
INPUTS
wildApp = the WildApp to init the frame of.
RESULT
None.
SEE ALSO
DisplayFrame(),RealyzeFrame()
wild.library/LoadFile
NAME
LoadFile
SYNOPSIS
data = LoadFile(offset,name,pool)
D0                        D0   D1     A0
UBYTE *LoadFile(ULONG offset, char *name, struct Pool *pool);
FUNCTION
Loads the file specified by the name allocating the memory from the specified pool. If no pool specified (passed 0) the wild pool is used. You should always pass your's app pool.
The offset specifies the empty space at the start of the data block. For example, if you have:
a file containing [0xAABBCCDDEEFF] and you specify offset = 0, the data you get will be this: [0xAABBCCDDEEFF].
a file containing [0xAABBCCDDEEFF] and you specify offset = 8, the data you get will be this: [0x0000000000000000AABBCCDDEEFF].
So, if you only want to load the file without putting a header then, simply specify 0 for offset. I added the offset option simply because I use internally this to load tables, so I have to load the data and then fill the header with the Table struct.
Note: this function supports XPK packed data ! You can pass a packed file, and will automatically be recognized and unpacked.
Note2: the data you get can be freed using FreeVecPooled, because it's allocated with AllocVecPooled.
INPUTS
offset = data header space size;
name = pointer to filename string;
pool = pointer to an exec's Pool (NULL = use wild's pool);
RESULT
data = the data loaded from the file.
SEE ALSO
FreeVecPooled
wild.library/LoadWildObject
NAME
LoadWildObject
SYNOPSIS
object= LoadWildObject(wildapp,tags)
D0 A0 A1
void *BuildWildObject(struct WildApp *wapp,struct TagItem *tags);
FUNCTION
Loads an object from a filehandle, or using a readhook.Note that the specified file (or filehandle, or readhook) must contain the object you specified, not anything else.Usually, you should load a Level, or a Scene, but you can also load Textures, or Aliens, or even Faces (but these are untested). See also tags.
Then, add more ATTRS and FRIENDS, used as you specified. Note that those will affect only the object you load, but not any other child: if you load a scene, you cannot modify the world, the arenas, the aliens loeded with it. You can only modify the scene. Note that the object you have is made by BuildWildObject, so you can free it with FreeWildObject(); but remember: FreeWildObject won't free the object's childs.
INPUTS
wildapp = your WildApp.
tags = taglist defining the file and the attrs of the object to load.
RESULT
object = a wildobject, or NULL if no object can be loaded.
SEE ALSO
BuildWildObject(),FreeWildObject(),objects.h
wild.library/RemWildApp
NAME
RemWildApp
SYNOPSIS
RemWildApp(wildApp)
A0
void RemWildApp(struct WildApp *wapp);
FUNCTION
Removes the app from the list of Wild applications, frees all the allocated memory (the pool), so levels, aliens, structs, anything. Modules are kept, they are an independent list, and also tables. Also the files loaded with LoadFileOffset() are flushed, if the wildApp's pool were passed.
INPUTS
wildApp = The application to kill.
RESULT
None.
SEE ALSO
AddWildApp
wild.library/SetWildAppTags
NAME
SetWildAppTags
SYNOPSIS
success = SetWildAppTags(WildApp,TagList)
D0 A0 A1
BOOL SetWildAppTags(struct WildApp *wapp,struct TagItem *tags);
FUNCTION
Modifies the application with the requested tags. You can specify all the App tags (exceptions: the Pools ones, the pool is defined firstly and then is always the same), and all the Modules tags, even the Module-specific tags.
The tags are firstly changed in the WildApp's taglist (wap_Tags), then are processed by Wild and then module by module, calling the SetModuleTags() for anyone. Note that WildApp's taglist DOES NOT KEEP the module-specific tags, but only the wild ones: for example, DrawDrScott module has some specific tags. These must be tracked by the module.
INPUTS
WildApp = the WildApp to modify.
TagList = the tags to change it.
RESULT
success = if something went wrong, is 0. For now, no more specific error codes.
SEE ALSO
AddWildApp(),wild.h
wild.library/--tags--
This section explains the tags used in Wild, grouped mainly by function.

wild.library/--Building tags--
WIBU_ObjectType
(REQUIRED) The type of object to create/modify.One of those OBJECT_???.
WIBU_BuildObject
If you want to create a NEW object, set this to true; you MUST also give the WIBU_WildApp tag, when creating new things, because wild needs to have memory from your pool.
WIBU_WildApp
Pass your WildApp here, NEEDED when creating NEW objects.
WIBU_ModifyObject
If you want to modify an existing object, pass it here. Obviously, you CAN'T specify that with WIBU_BuildObject !!!

wild.library/--Loading tags--
WILO_ObjectType
(REQUIDED) The type of object (OBJECT_???) to load.
WILO_FileName
The filename to load. If you specify that, the file will be loaded using dos.library. (in the future, also XPK support, but not now).
WILO_FileHandle
Alternative, you can specify a filehandle of an already open file. The file will be readed from the current position, no Seek(0) will be performed. This allows you to read files step by step.
WILO_ReadHook
Another alternative, you can specify a hook to be called to read from anywhere: you can fake and read from mem, or using trackdisk, or anything else. Hook convention: A0:Hook A1:Buffer to fill A2:Len to read.Your hook should contain something like a file handle in the h_Data.
WILO_LoadedAttrsFirst
Says to use first the attrs found in the file, and then, use yours attrs to fill the ones not present in the file. If you specify FALSE this, wild will first use your attrs and then fill the more needed with the ones loaded from the file.

wild.library/--Object tags--
Object tags conventions:
ATTR_<OBJECT>_<ATTRIBUTE> : <OBJECT> is the type of object that this tag affects. <ATTRIBUTE> is the attribute of the object that is modified, and can be a number or a pointer to a string or a pointer to some data, but NOT a pointer to another Wild object: FRIENDS and CHILDD are done for that. Example: ATTR_FACE_TXA.
FRIEND_<OBJECT>_<FRIEND> : <OBJECT> is the type of object which has this friend. <FRIEND> is the name of the attribute of the object that is modified, and MUST contain a pointer to another Wild object, of a specific type. Example: FRIEND_FACE_PLUS is to define the BSP-Tree node of a face, and needs a pointer to another face.
CHILD_<OBJECT>_<CHILD> : <OBJECT> is the type of object which has this child. <CHILD> is the name of the child that this object has, and MUST contain a pointer to another Wild object, of a specific type. Example: CHILD_SCENE_WORLD specifies wich World is child of the modified Scene.

wild.library/--WildApp tags--
WIAP_???Module
Specifies the module to load at startup for this application, of the specified group. If some modules aren't specified, Wild won't load them: some are not always needed, like Brokers or Light.
WIAP_BaseName
That's the base name, used when a wild requester says about an app, or in prefs handling (the prefs file for an application is in ENV:Wild/_<BaseName>.prefs) and should not have spaces in it, and should not be more than 16 chars.
WIAP_Name
That's the name of the application, you can specify here the name, even with spaces and everything you want.
WIAP_PrefsHandle
If you specify that to TRUE, the application will have its prefsfile, and this will override the tags you specify by default. That's HIGHLY recommenced, because you NEVER know the best configuration for any target machine. So, you should specify a veery basic configuration internally (like wireframe, of flat shaded, and a friendly display). If you have some presets you like, you can always save them with the WildPrefsEditor (when will come) and include them in your program.

wild.library/--WildThread tags--
WITH_Args
The args for the thread, to be read from the WildThread structure passed to your thread routine.
WITH_Entry
The initial PC of the thread: REQUIDED !
WITH_Name
The name for the new thread. Default "Generic Wild Thread..."
WITH_Priority
The new process priority. Default is 0.
WITH_Stack
The stack size. Default 4096.
WITH_TimeOut
The time to wait when killing for the task auto-killing, before killing it roughly. So, when RemWildThread is called, will send the "KillYourSelf" message, and will wait this ticks to see if the task kills itself, and then will remove it by hand.

wild.library/
NAME

a
SYNOPSIS
a
FUNCTION
a
INPUTS
a
RESULT
a
SEE ALSO
a